﻿@model IdentityServer4.Quickstart.UI.Models.LoginViewModel

<div class="login-page">
    <div class="page-header">
        <h1>Login</h1>
    </div>

    @Html.Partial("_ValidationSummary")

    <div class="row">
        <div class="col-sm-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Local Login</h3>
                </div>
                <div class="panel-body">

                    <form asp-route="Login">
                        <input type="hidden" asp-for="ReturnUrl" />

                        <fieldset>
                            <div class="form-group">
                                <label asp-for="Username"></label>
                                <input class="form-control" placeholder="Username" asp-for="Username" autofocus>
                            </div>
                            <div class="form-group">
                                <label asp-for="Password"></label>
                                <input type="password" class="form-control" placeholder="Password" asp-for="Password" autocomplete="off">
                            </div>
                            <div class="form-group">
                                <button class="btn btn-primary">Login</button>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>

        @if (Model.ExternalProviders != null && Model.ExternalProviders.Any())
        {
            <div class="col-md-6 col-sm-6 external-providers">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">External Login</h3>
                    </div>
                    <div class="panel-body">
                        <ul class="list-inline">
                            @foreach (var provider in Model.ExternalProviders)
                            {
                                <li>
                                    <a class="btn btn-default"
                                       asp-action="External"
                                       asp-route-provider="@provider.AuthenticationScheme"
                                       asp-route-returnUrl="@Model.ReturnUrl">
                                        @provider.DisplayName
                                    </a>
                                </li>
                            }
                        </ul>
                    </div>
                </div>
            </div>
        }
    </div>
</div>